package com.android.equipment.adapter

import android.view.View
import android.widget.ImageView
import com.android.equipment.R
import com.android.equipment.dao.Work
import com.android.equipment.dao.WorkEvidence
import com.blankj.utilcode.util.ImageUtils
import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class WorkEvidenceAdapter(layoutRes:Int, private val currentWork: Work): BaseQuickAdapter<WorkEvidence, BaseViewHolder>(layoutRes) {
    override fun convert(holder: BaseViewHolder, item: WorkEvidence) {
        val ivPic = holder.getView<ImageView>(R.id.iv_pic)
        Glide.with(ivPic.context).load("file://" + item.picUrl).into(ivPic)
        if (currentWork.status == 2){
            holder.getView<ImageView>(R.id.iv_delete).visibility = View.GONE
        }else{
            holder.getView<ImageView>(R.id.iv_delete).visibility = View.VISIBLE

        }
    }

}